package persistencia;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import util.Conexion;

public class TARTIDAO {
	
	public String getArticulo(String codigo)throws SQLException {
		PreparedStatement pstm = Conexion.obtenerConexion().prepareStatement("select trim(artdes) || ' - ' || artmed artdes from tarti where artcod=?");
		pstm.setString(1, codigo);
		ResultSet rs = pstm.executeQuery();
		String articulo="";
		if(rs.next()){
			articulo = rs.getString("artdes");
		}
		rs.close();
		pstm.close();
		return articulo;
	}

}
